home *** CD-ROM | disk | FTP | other *** search
/ Suzy B Software 2 / Suzy B Software CD-ROM 2 (1994).iso / unclcarl / gfahelp1 / cursor.lst < prev    next >
File List  |  1995-04-25  |  2KB  |  44 lines

  1. REM Press UNDO to quit ! Only prints the letter "A" in caps.
  2. '
  3. PRINT CHR$(27)+"e";           ! Create a cursor
  4. column|=1                     ! Set cursor position
  5. line|=1
  6. leave!=FALSE
  7. DO
  8.   ' Use TEXT commands as PRINT commands will conflict with the cursor
  9.   DEFTEXT 1,0,0,6
  10.   TEXT 10,180,"line:  "+STR$(line|)+"  "
  11.   TEXT 10,160,"column:  "+STR$(column|)+"  "
  12.   SELECT INP(2)                               ! Select a key
  13.   CASE 200,94                                 ! Arrow up
  14.     PRINT CHR$(27)+"A";                       ! Cursor up
  15.     IF line|>1                                ! If the line is greater than 1
  16.       DEC line|                               ! DECrease it.
  17.     ENDIF
  18.   CASE 208                                    ! Arrow down
  19.     PRINT CHR$(27)+"B";                       ! Cursor down
  20.     IF line|<25                               ! If line is less than 25
  21.       INC line|                               ! INCrease it
  22.     ENDIF
  23.   CASE 205,62                                 ! Arrow right
  24.     PRINT CHR$(27)+"C";                       ! Cursor right
  25.     IF column|<80
  26.       INC column|
  27.     ENDIF
  28.   CASE 203,60,8                               ! Arrow left
  29.     PRINT CHR$(27)+"D";                       ! Cursor left
  30.     IF column|>1
  31.       DEC column|
  32.     ENDIF
  33.   CASE 65                                     ! Prints the letter A
  34.     PRINT "A";
  35.   CASE 27                                     ! ESC key jump to left
  36.     IF column|>1
  37.       PRINT AT(1,line|);CHR$(27)+"e";
  38.       column|=1
  39.     ENDIF
  40.   CASE 225                                    ! UNDO key
  41.     EXIT IF TRUE
  42.   ENDSELECT
  43. LOOP
  44.